home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / September 96 / Re Using QuickDrawGX in ODF.2 < prev    next >
Encoding:
Internet Message Format  |  1996-09-19  |  1.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Using QuickDrawGX in ODF
  2. Sent:        9/3/96 12:06 PM
  3. Received:    9/3/96 12:06 PM
  4. From:        Brad Pettit <bpettit@apple.com>
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List
  7.  
  8.  
  9.  
  10. You're right about the rotated text in that there is no direct support 
  11. for rotated text in the framework. However, I'm not sure from your 
  12. question if you ware wondering how picture contexts work. Here is an 
  13. example.
  14.  
  15.  
  16. // create a 100x100 picture
  17. FW_CRect picBounds(FW_kFixed0, FW_kFixed0, FW_IntToFixed(100), 
  18. FW_IntToFixed(100));
  19. FW_CPicture myPicture; // create an empty picture
  20.  
  21. {
  22.   // create a picture context so that we can draw into the picture
  23.             FW_CPictureContext picContext(ev, myPicture, picBounds.Width(), 
  24. picBounds.Height());
  25.             picContext.SetClipRect(pictureBounds);
  26.  
  27.    MyDrawStuffHere(ev, pictureContext, pictureBounds);
  28. }
  29.  
  30.  
  31. myPicture now contains all the drawing done in MyDrawStuffHere.
  32. We can draw the picture anywhere using:
  33.  
  34. FW_CPictureShape::RenderPicture(viewContext, myPicture, 
  35. myDestinationRect);
  36.  
  37.  
  38. --Brad